package com.jfm.jfmm.collector.enums.snmp;

import lombok.Getter;

/**
 * @author DYang
 * @since 2024-10-08 23:13
 * SNMP 协议
 */
@Getter
public enum SNMPProtocol {

    V1(0,"v1"),
    V2C(1,"v2c"),
    V3(3,"v3")
    ;

    private final int version;
    private final String protocol;

    SNMPProtocol(int version,String protocol) {
        this.version = version;
        this.protocol = protocol;
    }

    /**
     * 根据版本号获取枚举
     * @param version
     * @return
     */
    public static SNMPProtocol getVersion(String version) {
        for (SNMPProtocol value : values()) {
            if (value.protocol.equals(version)) return value;
        }
        return null;
    }
}
